
local time = 20
local duanNum = 30
local duans = {}

function split()
	local unit = time / duanNum
	for i = 1, duanNum do
		table.insert(duans, unit * i )
	end
end

split()
print(#duans)
for i = 1, duanNum do
	print("index : " .. i .. "," .. duans[i])
end

function getDuanIndex( num )
	for i = 1, duanNum do
		if num < duans[i] then
			return i
		end
	end
	return duanNum
end

print("In " .. getDuanIndex(0.2))

local num = 
print(num)
